/**************************************************************************************** 
 Copyright © 2003-2012 hbasesoft Corporation. All rights reserved. Reproduction or       <br>
 transmission in whole or in part, in any form or by any means, electronic, mechanical <br>
 or otherwise, is prohibited without the prior written consent of the copyright owner. <br>
 ****************************************************************************************/
package com.hbasesoft.hamibot;

import java.util.Arrays;
import java.util.Map;
import java.util.stream.Collectors;

import lombok.AccessLevel;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * <Description> <br>
 * 
 * @author ww200<br>
 * @version 1.0<br>
 * @taskId <br>
 * @CreateDate 2024年12月18日 <br>
 * @since V1.0<br>
 * @see com.hbasesoft.hamibot <br>
 */
@Getter
@AllArgsConstructor(access = AccessLevel.PRIVATE)
public enum Cmd {

    /** 退出 */
    END(-1, "退出"),

    /** 复位 */
    REST(1, "复位"),

    /** 后退 */
    RETURN_BACK(2, "后退"),

    /** 选择应用 */
    CHOOSE_APP(3, "选择应用"),

    /** 打开应用 */
    OPEN_APP(4, "打开应用"),

    /** 点击目标 */
    CLICK_OBJ(5, "点击目标"),

    /** 点击范围 */
    CLICK_RANGE(6, "点击范围"),

    /** 下滑 */
    SCROLL_DOWN(7, "下滑"),

    /** 上滑 */
    SCROLL_UP(8, "上滑"),

    /** 小下滑 */
    SCROLL_DOWN_MIN(9, "小下滑"),

    /** 小上滑 */
    SCROLL_UP_MIN(10, "小上滑"),

    /** 检测关键字 */
    CHECK_KEYWORDS(11, "检测关键字"),

    /** 点击同行的文字 */
    CLICK_TEXT(12, "点击同行的文字"),

    /** 关闭广告 */
    CLOSE_AD(13, "关闭广告"),

    /** 左向右滑动 */
    LEFT_TO_RIGHT(14, "左向右滑动"),

    /** 右向左滑动 */
    RIGHT_TO_LEFT(15, "右向左滑动"),

    /** 点击模糊文字 */
    TEXT_CONTAINS(16, "点击模糊文字"),

    /** 点击规则文字 */
    TEXT_MATCHES(17, "点击规则文字"),

    /** 点击精确描述 */
    DESC(18, "点击精确描述"),

    /** 点击模糊描述 */
    DESC_CONTAINS(19, "点击模糊描述"),

    /** 点击规则描述 */
    DESC_MATCHES(20, "点击规则描述"),;

    /** code */
    private final int code;

    /** msg */
    private final String msg;

    /**
     * Description: <br>
     * 
     * @author 王伟<br>
     * @taskId <br>
     * @return <br>
     */
    public static Map<Integer, String> toMap() {
        return Arrays.stream(Cmd.values()).collect(Collectors.toMap(v -> v.getCode(), v -> v.getMsg()));
    }
}
